import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-03-21
 * Time: 15:48
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] ints = new int[n * 3];
        for (int i = 0; i < ints.length; i++) {
            ints[i] = scanner.nextInt();
        }
        Arrays.sort(ints);
        long res = 0;//结果可能超过int
        int k = ints.length - 2;
        while (k >= n - 1) {
            res += ints[k];
            k -= 2;
        }
        System.out.println(res);
    }
}


